package com.shujia.java.day18.demo6;

/**
 * @Description: Demo 我必须想让李四运行完
 * @Author: 王火火
 * @Date: 2019/8/20 11:09
 * <p>
 * <p>
 * join 和 yield
 * 线程的礼让yield  礼让有可能让也有可能不让
 *     强制礼让(加入)join
 */
public class Demo {
    public static void main(String[] args) throws Exception {
        //创建线程
        MyThreadDemo t1 = new MyThreadDemo();
        MyThreadDemo t2 = new MyThreadDemo();
        MyThreadDemo t3 = new MyThreadDemo();
        //改名字
        t1.setName("张三");
        t2.setName("李四");
        t3.setName("王五");
        //启动
        t1.start();
        t2.start();
        t3.start();
    }
}
